<?php
/**
 * Created by PhpStorm.
 * User: fengtian
 * Date: 15-4-1
 * Time: 下午2:45
 */
?>
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/css/style.css" type="text/css" media="all"/>
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css"
      media="all"/>
<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<link href="<?php echo URL::base() ?>media/vendor/fixtable/css/component.css" rel="stylesheet">
<link href="<?php echo URL::base() ?>media/vendor/fixtable/css/normalize.css" rel="stylesheet">
<link href="<?php echo URL::base() ?>media/vendor/css/jquery-ui-timepicker-addon.min.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-timepicker-addon.min.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-timepicker-zh-CN.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/Validform_v5.3.2_ncr_min.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/plugins/iframeTools.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.printPage.js"></script>
<script src="<?php echo URL::base() ?>media/js/jquery.form.js"></script>
<style>
    .table td, .table th {
        text-align: center;
    }

    .form-horizontal .control-label {
        width: 100px;
    }

    .form-horizontal .controls {
        margin-left: 110px;
    }

    a.xiazai:hover {
        text-decoration: none;
    }

    table tbody tr:nth-child(2n) {
        background-color: #f5f5f5;
    }

    .table th, .table td {
        border: 1px solid #ffffff;
    }

    .gy-navtent2-input label {
        width: 120px;
        text-align: right;
    }

    .gy-navtent2-input {
        margin-bottom: 10px;
    }

</style>

<div class="gy-navtent2">
    <form class="form-inline" action="<?php echo URL::base() ?>checkstock/skuactive" method="get">
        <div class="gy-navtent2-input">
            <label>平台：</label>
            <select class="form-control input-sm span2" name="stage">
                <option>全部</option>
                <option value="1" <?php if(isset($stage)&&$stage==1){
                    echo "selected";
                } ?>>ebay
                </option>
                <option value="2" <?php if(isset($stage)&&$stage==2){
                    echo "selected";
                } ?>>smt
                </option>
                <option value="3" <?php if(isset($stage)&&$stage==3){
                    echo "selected";
                } ?>>amz
                </option>
                <option value="4" <?php if(isset($stage)&&$stage==4){
                    echo "selected";
                } ?>>wish
                </option>
            </select>
        </div>
        <div class="gy-navtent2-input">
            <label>状态：</label>
            <select class="form-control input-sm span2" name="status">
                <option>全部</option>
                <option value="1" <?php if(isset($status)&&$status==1){
                    echo "selected";
                } ?>>开启
                </option>
                <option value="2" <?php if(isset($status)&&$status==0){
                    echo "selected";
                } ?>>关闭
                </option>
            </select>
        </div>
        <div class="gy-navtent2-input">
            <label>sku：</label>
            <input type="text" name="sku" class="span2" value="<?php echo isset($sku)?$sku:''?>"/>
        </div>
        <div class="gy-navtent2-input">
            <label>活动时间：</label>
            <input type="text" class="date span2" name="start_time" value="<?php echo isset($begin)?$begin:'' ?>"
                   placeholder="开始时间" readonly="readonly"/>
            <input type="text" class="date span2" name="end_time" value="<?php echo isset($end)?$end:'' ?>"
                   placeholder="结束时间" readonly="readonly"/>
            <input type="submit" class="btn btn-info" value="查询"/>
        </div>
    </form>
    <div class="active_content">
        <table class="table table1 table-bordered" style="border-collapse: collapse;">
            <thead>
            <tr style="background-color:#4EA392;color:#fff; font-weight:bold;">
                <th>序号</th>
                <th>SKU</th>
                <th>平台</th>
                <th>开始时间</th>
                <th>结束时间</th>
            </tr>
            </thead>
            <tbody>
            <?php
            if(isset($result)){
                foreach($result as $k => $v):?>
                    <tr>
                        <td><?php echo ++$k; ?> </td>
                        <td><?php echo $v['sku']; ?></td>
                        <td><?php if($v['stage']==1){
                                echo "ebay";
                            }elseif($v['stage']==2){
                                echo "smt";
                            }elseif($v['stage']==3){
                                echo "amz";
                            }elseif($v['stage']==4){
                                echo "wish";
                            };?> </td>
                        <td><?php echo $v['begin']; ?> </td>
                        <td><?php echo $v['end']; ?> </td>
                    </tr>
                <?php endforeach;
            }
            ?>
            </tbody>

        </table>
        <div>
            <?php if(isset($pagination)){
                echo $pagination;
            }
            ?>
        </div>
    </div>
</div>

<script>
    $(function () {
        $(".date").datetimepicker({
            dateFormat: 'yy-mm-dd',
            timeFormat: 'HH:mm:ss'
        });
    })
</script>